{extend name="public:common_index"/}
{block name="main"}
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-list"></i> 用户列表</h3>
    </div>
    <div class="panel-body">

        <div class="navbar navbar-default">
            <form action="" id="search-form2" class="navbar-form form-inline" method="get" onsubmit="return false">

                <div class="form-group">
                    <label class="control-label" for="input-order-id">昵称或手机号:</label>
                    <div class="input-group">
                        <input type="text" name="keyword" value="{$Think.get.keyword}" placeholder="请输入昵称或手机号"
                               class="form-control">
                    </div>

                </div>
                <div class="form-group">
                    <label class="control-label" for="input-order-id">用户ID:</label>
                    <div class="input-group">
                        <input type="text" name="uuid" value="{$Think.get.uuid}" placeholder="用户ID" class="form-control">
                    </div>

                </div>
                <div class="form-group">
                    <label class="control-label" for="input-order-id">备注:</label>
                    <div class="input-group">
                        <input type="text" name="remark" value="{$Think.get.remark}" placeholder="备注"
                               class="form-control">
                    </div>

                </div>
                <label class="control-label" for="input-order-id">类型</label>
                <select class="form-control" name="type">
                    <option id="type" value="">全部</option>
                    <option id="type1" value="1">收入</option>
                    <option id="type2" value="2">支出</option>
                </select>

                <label class="control-label" >金币类型</label>
                <select class="form-control" name="coin_type">
                    <option id="coin_type" value="">全部</option>
                    <option id="coin_type1" value="1">钻石</option>
                    <option id="coin_type2" value="2">心币</option>
                </select>
                <label class="control-label" >性别</label>
                <select class="form-control" name="sex">
                    <option id="sex" value="">全部</option>
                    <option id="sex1" value="1">男</option>
                    <option id="sex2" value="2">女</option>
                </select>
                <div class="form-group">
                    <label class="control-label" for="input-order-id">时间筛选</label>
                    <div class="input-group">
                        <input type="text" name="start" value="{$Think.get.start}" placeholder="选择开始时间"
                               class="form-control timepicker">
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group">
                        <input type="text" name="end" value="{$Think.get.end}" placeholder="选择结束时间"
                               class="form-control timepicker">
                    </div>
                </div>
                <button type="submit" onclick="javascript:document.getElementById('search-form2').submit();"
                        id="button-filter search-order" class="btn btn-primary"><i class="fa fa-search"></i> 筛选
                </button>
                <input type="hidden" name="download" >
                <button type="submit"
                        id="download" class="btn btn-primary"><i class="fa fa-search"></i> 下载
                </button>
                <a href="{:url('index')}" class="btn btn-primary pull-right"><i class="fa "></i>返回</a>
                <!--<a href="{:url('examiner_batch')}" class="btn btn-primary pull-right"><i class="fa fa-folder-open-o"></i>批量导入</a>-->
            </form>
        </div>
        <div id="ajax_return">
            <form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
                <div class="table-responsive">
                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <td>ID</td>
                            <td>用户昵称</td>
                            <td>用户ID</td>
                            <td>UUID</td>
                            <td>性别</td>
                            <td>类型</td>
                            <td>金币类型</td>
                            <td>金额</td>
                            <td>详情</td>
                            <td>备注</td>
                            <td>产生时间</td>
                        </tr>
                        </thead>
                        <tbody>
                        <!-- 列表循环开始 -->
                        {volist name="rows" id="row" key="key"}
                        <tr>
                            <td>{$row.d_id}</td>
                            <td class="emojstext">{$row.nick_name}</td>
                            <td ><a href="{:url('user/index')}?user_id={$row.user_id}">{$row.user_id}</a></td>
                            <td >{$row.uuid}</td>
                            <td>{if $row.sex eq 1}男{else}女{/if}</td>
                            <td>{if $row.type eq 1}收入{else}支出{/if}</td>
                            <td>{if $row.coin_type eq 1}钻石{else}心币{/if}</td>
                            <td><a href="{:url('user/analysis',['id'=>$row.user_id])}">{$row.money}</a></td>
                            <td class="emojstext">{$row.title} </td>
                            <td>{$row.remark}</td>
                            <td>{$row.create_time}</td>
                        </tr>
                        {/volist}
                        <!-- 列表循环结束 -->
                        </tbody>
                    </table>
                </div>
            </form>
        </div>
        <div id='pagerarea'>{$pageHTML}</div>
    </div>
</div>
{/block}
{block name="js"}
<script>
    $("#download").click(function () {
        $("input[name='download']").val('download');
        document.getElementById('search-form2').submit();
    });

    $(function () {




        $.each($('.emojstext'),function (k,v) {
            var $text = $(v);
            var html = $text.html().trim().replace(/\n/g, '<br/>');
            html = jEmoji.softbankToUnified(html);
            html = jEmoji.googleToUnified(html);
            html = jEmoji.docomoToUnified(html);
            html = jEmoji.kddiToUnified(html);
            $text.html(jEmoji.unifiedToHTML(html));
        });


        var is_agent = "{$Think.get.is_agent}";
        $('#is_agent'+is_agent).attr('selected','selected');

        var sex = "{$Think.get.sex}";
        $('#sex'+sex).attr('selected','selected');


        var coin_type = "{$Think.get.coin_type}";
        $('#coin_type'+coin_type).attr('selected','selected');
    })
</script>
{/block}




